import 'package:flutter/material.dart';

void main() => runApp(tarbat());



class tarbat extends StatefulWidget {
  @override
  tarbatImp createState() => tarbatImp();
}


class tarbatImp extends State<tarbat> {


  @override
  Widget build(BuildContext context) {
    return
      new MaterialApp(
        home: new DefaultTabController(
          length: 3,
          child: new Scaffold(
            appBar: new AppBar(
              title: const Text('Tabbed AppBar'),
              bottom: new TabBar(
                isScrollable: true, //是否可滚动
                indicatorColor: Colors.red, // 选中的那个横条的颜色
                indicatorWeight: 3,  // 选中的那个横条的高
                indicatorPadding: const EdgeInsets.all(2), // 底部指示器的Padding
                indicatorSize: TabBarIndicatorSize.tab, //选中那个横条的宽是随文字还是随图片
                labelColor: Colors.deepPurple, // 文字的颜色 当设了 unselectedLabelColor,就是选中的颜色
                labelStyle: TextStyle(fontSize: 18), // 文字的样式
                unselectedLabelColor: Colors.teal, //未选中的颜色
                unselectedLabelStyle: TextStyle(fontSize: 12), //未选中的样式
                tabs: [
                  new Tab(
                    text: "CAR",
                    icon: new Icon(Icons.directions_car),
                  ),
                  new Tab(
                    text: "BICYCLE",
                    icon: new Icon(Icons.directions_bike),
                  ),
                  new Tab(
                    text: "BOAT",
                    icon: new Icon(Icons.directions_boat),
                  ),
                ]
              ),
            ),
            body:
            TabBarView(

              children: [
                Icon(Icons.directions_car, size: 128), // 第一页的内容
                Icon(Icons.directions_transit, size: 128), // 第二页的内容
                Icon(Icons.directions_bike, size: 128), // 第三页的内容
              ],
            ),
          ),
        ),
      );

}
}




